﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExpertMIS.Brokers;
using System.Collections;
using ExpertMIS.Entities;

namespace ExpertMIS.UserControl
{
    public partial class ucColumnLargeView : System.Web.UI.UserControl
    {
        private ADMColumnBroker _columnBroker = new ADMColumnBroker();
        private ADMArticleBroker _articleBroker = new ADMArticleBroker();

        private int _articleCountOnColumn = 10;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected string ColumnName
        {
            get;
            set;
        }

        protected string More
        { 
            get; 
            set; 
        }

        public void RefreshColumn(string columnOID)
        {
            ADMColumnEntity column = _columnBroker.GetColumnEntityByOID(columnOID);
            if (column != null)
            {
                ColumnName = column.Name;
                More = Page.ResolveUrl("~/Columns/ColumnView.aspx?oid=") + column.OID;
                repColumnView.DataSource = _articleBroker.GetArticlesByColumn(columnOID, _articleCountOnColumn);
                repColumnView.DataBind();
            }
        }
    }
}